/*
 * $Id: JOGLTools.java,v 1.5 2007-09-21 11:57:46 shampoo Exp $ Created on 15.02.2005
 */
package net.sourceforge.ftgl.util.loader;

import java.awt.Toolkit;
import java.util.logging.Logger;

/**
 * @author funsheep
 */
public class JOGLTools
{
	
	private static final Logger LOGGER = Logger.getLogger("");

	
	public static void loadLibrary()
	{
		// need to load jawt on all non mac os platforms to avoid "jawt.lib not found" bug
		final LibraryLoader ll = new LibraryLoader();
		if (!ll.getOSInfo().getOSName().equals(OSInfo.OS_MACOSX))
		{
			try
			{
				System.loadLibrary("jawt");
			} catch (UnsatisfiedLinkError e)
			{
				// e.printStackTrace();
				LOGGER.info("Could not load library jawt through system call. Trying workaround");
				Toolkit.getDefaultToolkit();
			}
		}

		com.sun.opengl.impl.NativeLibLoader.disableLoading();
		com.sun.gluegen.runtime.NativeLibLoader.disableLoading();
		ll.load("gluegen-rt");
		ll.load("jogl_awt");

		// drihack now loaded through gluegen-rt

		ll.load("jogl");
		
	}
}